Skip to content

feat: add OIDC/Keycloak authentication support via Traefik#34

Closed
boehlke wants to merge 8 commits into
OpenSlides:mainfrom
kryptance:keycloak-on-relational-db
Closed

feat: add OIDC/Keycloak authentication support via Traefik#34
boehlke wants to merge 8 commits into
OpenSlides:mainfrom
kryptance:keycloak-on-relational-db

Conversation

@boehlke

@boehlke boehlke commented Feb 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add OIDC authentication middleware using traefik-oidc-auth plugin (v0.17.0)
  • Configure Traefik routes for Keycloak (/auth), OAuth2 callbacks (/oauth2), OIDC provisioning, and who-am-i endpoints
  • Add unauthenticated autoupdate-theme route (priority 50) for public theme data
  • Skip auth service in OIDC mode (authentication handled by Keycloak)
  • Configure session cookie (SameSite=lax, HttpOnly=false for JS access), logout redirect, and PKCE

Test plan

  • docker compose up with OIDC env vars → Keycloak login page served at /auth
  • Login redirects through /oauth2/callback/system/auth/oidc-provision → dashboard
  • /system/autoupdate/theme returns 200 without authentication
  • Logout via /oauth2/logout redirects back to login page
  • Non-OIDC mode (OIDC_ENABLED unset) still works as before

🤖 Generated with Claude Code

André Böhlke and others added 7 commits January 19, 2026 01:03
- Add OIDC configuration variables to entrypoint
- Generate OIDC middleware config when OIDC_ENABLED is set
- Apply oidc-auth middleware to routes automatically
- Add documentation for plugin loading via command-line
Pass CLI args through command.sh to enable plugin loading.
Add experimental plugins section to static config when OIDC is
enabled. Fix Go template escaping in OIDC middleware headers
and add LoginUri configuration.
- Add /system/auth/oidc-provision route with OIDC middleware
- Add /system/auth/who-am-i route without OIDC middleware
- Skip auth service routing in OIDC mode
- Fix Header template syntax for traefik-oidc-auth plugin
- Enable debug logging for troubleshooting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Configure traefik-oidc-auth plugin for Keycloak authentication
- Forward access token to backend via Authorization header

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add autoupdate-theme router for anonymous theme data access
- Move oauth2 route from static file to dynamic entrypoint.sh
- Apply oidc-auth middleware to oauth2 route when OIDC enabled

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Set HttpOnly: false so the client can detect the OIDC session cookie
and use the correct logout flow. Add explicit PostLogoutRedirectUri
to redirect back to the app after Keycloak logout.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The autoupdate-theme route (priority 15) was being matched after the
general autoupdate route which has OIDC middleware, causing 401 errors
for unauthenticated theme requests. Increase to priority 50 so it
matches first without requiring authentication.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@boehlke boehlke mentioned this pull request Feb 9, 2026
@boehlke boehlke marked this pull request as draft February 9, 2026 10:21
@boehlke boehlke closed this Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant